package net.dgg.iboss.sc.backservice.task.dao;

import net.dgg.iboss.sc.backservice.task.entity.UserEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * user dao层
 * Created by IntelliJ IDEA.
 * Developer:Liu Yao
 * Date:2018/2/24
 * Time:11:08
 */

@Component
public interface UserRecorderDAO {

    /**
     * 根据用户角色以及在职状态查询用户
     *
     * @param codes
     * @param status
     * @return
     */
    List<UserEntity> findUserByRoleCodes(@Param("codes") String[] codes, @Param("status") Integer status);

    UserEntity findUserEntityByUserId(long userId);

    UserEntity findUserEntityByLoginName(String loginName);

    /**
     * 根据角色以及部门查找指定状态用户
     *
     * @param codes
     * @param status
     * @param orgIds
     * @return
     */
    List<UserEntity> findUserByRoleCodesAndOrgs(@Param("codes") String[] codes, @Param("status") Integer status, @Param("orgIds") List<Long> orgIds);
}
